/*
 * @Author: jianfanfan 是是是
 * @Date: 2025-09-04 16:03:13
 * @LastEditors: jianfanfan 是是是
 * @LastEditTime: 2025-09-16 10:28:28
 * @FilePath: \nest-project\src\main.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
/*
 * @Author: jianfanfan 是是是
 * @Date: 2025-09-04 16:03:13
 * @LastEditors: jianfanfan 是是是
 * @LastEditTime: 2025-09-12 11:35:57
 * @FilePath: \nest-project\src\main.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { NestExpressApplication } from '@nestjs/platform-express';
import { Request, Response, NextFunction } from 'express';
import { ValidationPipe, VersioningType } from '@nestjs/common';
import { HelloFilter } from './hello.filter';
import { MyLogger } from './MyLogger';

async function bootstrap() {
  const app = await NestFactory.create<NestExpressApplication>(AppModule, {
    cors: true,
  });
  //   app.useStaticAssets('public', { prefix: '/static' });
  //   app.use(function (req: Request, res: Response, next: NextFunction) {
  //     next();
  //   });
  //   app.useGlobalPipes(new ValidationPipe());
  //   app.useGlobalFilters(new HelloFilter());
  app.useLogger(new MyLogger())
  app.enableVersioning({
    type: VersioningType.URI,
  });
  await app.listen(process.env.PORT ?? 3000);
}
bootstrap();
